package spring.pojo.HelloWorld.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import spring.pojo.HelloWorld.dao.UserDao;
import spring.pojo.HelloWorld.service.UserService;

/**
 * @author Yancy xiao
 * @create 2022-11-18 17:16
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public void saveUser() {
        userDao.saveUser();
    }

    /* 依赖注入和基于xml管理bean需要set方法，利用set方法/构造器完成注入*/
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
